/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package times.persistence.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "price_slaughter_lamb")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PriceSlaughterLamb.findAll", query = "SELECT p FROM PriceSlaughterLamb p"),
    @NamedQuery(name = "PriceSlaughterLamb.findById", query = "SELECT p FROM PriceSlaughterLamb p WHERE p.id = :id"),
    @NamedQuery(name = "PriceSlaughterLamb.findByWeigth", query = "SELECT p FROM PriceSlaughterLamb p WHERE p.weigth = :weigth"),
    @NamedQuery(name = "PriceSlaughterLamb.findByPrice", query = "SELECT p FROM PriceSlaughterLamb p WHERE p.price = :price"),
    @NamedQuery(name = "PriceSlaughterLamb.findByRepresentativeName", query = "SELECT p FROM PriceSlaughterLamb p WHERE p.representativeName = :representativeName")})
public class PriceSlaughterLamb implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "weight")
    private Double weight;
    @Column(name = "price")
    private Double price;
    @Column(name = "representative_name")
    private String representativeName;
    @JoinColumn(name = "price_source_slaughter_header_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private PriceSourceSlaughterHeader priceSourceSlaughterHeaderId;
    @JoinColumn(name = "foreas_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Foreas foreasId;
    @JoinColumn(name = "category_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Category categoryId;

    public PriceSlaughterLamb() {
    }

    public PriceSlaughterLamb(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Double getWeigth() {
        return weight;
    }

    public void setWeigth(Double weigth) {
        this.weight = weigth;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getRepresentativeName() {
        return representativeName;
    }

    public void setRepresentativeName(String representativeName) {
        this.representativeName = representativeName;
    }

    public PriceSourceSlaughterHeader getPriceSourceSlaughterHeaderId() {
        return priceSourceSlaughterHeaderId;
    }

    public void setPriceSourceSlaughterHeaderId(PriceSourceSlaughterHeader priceSourceSlaughterHeaderId) {
        this.priceSourceSlaughterHeaderId = priceSourceSlaughterHeaderId;
    }

    public Foreas getForeasId() {
        return foreasId;
    }

    public void setForeasId(Foreas foreasId) {
        this.foreasId = foreasId;
    }

    public Category getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Category categoryId) {
        this.categoryId = categoryId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PriceSlaughterLamb)) {
            return false;
        }
        PriceSlaughterLamb other = (PriceSlaughterLamb) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "times.persistence.entities.PriceSlaughterLamb[ id=" + id + " ]";
    }
    
}
